import { ref } from 'vue'
import request from '@/utils/request.js'
export const courseList = () => {
   //  return request.get('/course/getList')
   return request.get('/course/getCourseList')
}
export const courseUserIdList = () => {
   //  return request.get('/course/getList')
   return request.get('/course/getCourseListUserId')
}
export const courseNameList = (courseName) => {
   return request.get('/course/selectCourceListByName/' + courseName)
}
//  export const courseIdList =(directionId)=>{
//     return request.get('/course/selectListDirectionId/'+directionId)
//  } 
export const directionList = () => {
   return request.get('/direction/select')
}
export const aaaaa = () => {
   return request.get('/user/select')
}

 //查询专业课程
export const professional=()=>{
   return request.get("/course/listProfessional")
}

//查询专业方向
export const  direction=()=>{
   return request.get("/course/listDirection")
}

//创建课程
export const  saveCourse=(course)=>{
   return request.post("/course/save",course)
}
//查询当前作业详细
export const select =(taskId)=>{
   return request.get('/student/selectTaskManager/'+taskId)
} 
//添加作业保存到redis
export const addTaskSave=(taskSave)=>{
   return request.post("/student/insertTaskRedis",taskSave)
} 
//从redis中取出当前用户保存的作业
export const selectTaskSave=(taskId)=>{
   return request.get("/student/getTaskRedis/"+taskId)
}


// 查询所有作业
export const selectAllTask =(sectionId)=>{
   return request.get("/task/getTask?sectionId="+sectionId)
}
//根据作业id查询作业详情
export const selectTaskById =(taskId)=>{
   return request.get("/task/getByTaskId?taskId="+taskId)
}

//添加作业或者修改作业
export const saveOrUpdate =(taskManger)=>{
   return request.post("/task/saveOrUpdate",taskManger)
}

//获取创建人名字
export const selectUserInfo=()=>{
   return request.get("/user/select")
}

//根据小节ID获取小节名称
export const selectSectionName=(sectionId)=>{
   return request.get("/section/selectSectionName?sectionId="+sectionId)
}